#!/usr/bin/env bash

requiremnts_osx_java_fail()
{
  __rvm_which java >/dev/null 2>&1 || return $?
  java_version=$(java -version 2>&1  | __rvm_awk -F'"' '/ version /{print $2}')
  case "$java_version" in
    (1.5.*)
      printf "%b" "\n\nWARNING: A very outdated JAVA version is being used ($java_version), it is strongly recommended that you upgrade to the latest version.\n\n"
      ;;
    (1.3.*|1.4.*)
      printf "%b" "\n\nERROR: Unsupported JAVA version $java_version. In order to install and use JRuby you must upgrade to the latest JAVA version.\n\n"
      return 1
      ;;
  esac
  true # for OSX
}
